package com.git.smp.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import com.git.smp.filter.LoginInterceptor;




@Configuration
public class LoginConfig  implements WebMvcConfigurer{
	
	@Autowired
	LoginInterceptor loginInterceptor;
	
	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		InterceptorRegistration interceptorRegistration =   registry.addInterceptor(loginInterceptor);
		interceptorRegistration.addPathPatterns("/**");
		interceptorRegistration.excludePathPatterns(
				"/",
				"/user/selectAll",
				"/service/selectSystemInfoAll",
				"/dataDictionary/selectAll",
				"/user/login",
				"/user/tokenRefresh",
				"/img/**",
				"/fonts/**",
				"/js/**",
				"/css/**",
				"/esbHelp/**",
				"/index.html",
				"/favicon.ico",
				"/org/getOrgAllList",
				"/refresh",
				"/requirementInfo/saveRequirementInfo",
				"/websocket/index",
				"/guide",
				"/guide/**",
				"/serviceExample/**"
				);
	
	}

}
